四、創(chuàng)建一個文件夾(down)只能下載,不能上傳
mkdir down /home/myftp
chmod 555 down
五、創(chuàng)建一個文件夾(up)只能上傳,不能下載和刪除
? ? mkdir up /home/myftp
? ? chmod 755 up
? ? chattr +i /home/up
六、關(guān)閉防火墻(注意centos7版本防火墻firewalld需要手動開啟端口,iptables版本端口默認(rèn)開放)
關(guān)閉SELinux
輸入vim /etc/selinux/config,
firewall-cmd --zone=public --add-port=21/tcp --permanent ? 開放端口20 21 22
firewall-cmd --permanent --zone=public --add-service=ftp ? ? ? 或者直接放開ftp服務(wù)
firewall-cmd --zone=public --list-ports ? ? ? ? ? ? ? ? ? ?查詢端口
七、開啟vsftpd服務(wù),重啟firewalld防火墻
? ? systemctl start vsftpd ? ? #centos7中使用
? ? service vsftpd start ? ?#redhat,centos6中使用
? ? 停止vsftpd服務(wù)
? ? systemctl stop vsftpd ? ?#centos7中使用
? ? service vsftpd stop ? #redhat,centos6中使用
? ? systemctl restart ? firewalld ? 重啟防火墻